export default ({app, redirect})=>{
  app.router.beforeEach((to, from, next) => {
    // next(true)/next(false)
    console.log('前置守卫')
    if (to.name === 'goods') {
      redirect('/index')
    } else {
      next(true)
    }
  })

  app.router.afterEach((to, from)=>{
    console.log('后置守卫')
  })
}
